home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #14
/
Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO
/
math
/
maca_101.zip
/
MASSCALC.DOC
< prev
next >
Wrap
Text File
|
1996-01-30
|
58KB
|
1,369 lines
MASSCALC
VERSION 1.00
OPERATIONS MANUAL
by Ralph W. Reid
125 Parmac #32
Chico, CA 95926
USA
http://www2.athenon.com/~rreid
Released: January 19, 1996
DESCRIPTION: MASSCALC is a calculator with no fancy screen
displays to get in the way of the needed information. A variety
of commands and functions have been included in MASSCALC to
perform a wide range of mathematical operations. Input is read
from standard input, so files may be directed into MASSCALC which
contain a series of equations and commands. Output is written to
standard output, so all results can be redirected to an output
file. An option is provided to capture output into a history
file as it is produced, and this history file may be opened or
closed during calculator operation to capture only the results
desired. Some demo files (*.DEM) have been included with this
package which may be redirected or piped into MASSCALC to
demonstrate some of the features of this package. See the demo
files included with this package or your operating system manual
for more information concerning piping and redirecting files.
SYNOPSIS: MASSCALC [-v | -version]
where [-v] or [-version] is an optional parameter which causes
MASSCALC to display a version screen at start-up (a version
screen is automatically displayed in the shareware and student
distributions).
HOW TO GET OUT OF MASSCALC: The best ways to get out of MASSCALC
are to run the exit or quit commands, or to enter the end of file
character (CTRL-Z) on a line by itself. When a file is
redirected or piped into MASSCALC, MASSCALC terminates when it
finds one of these three items in the input file, or when the end
of the input file is reached. Entering CTRL-C or CTRL-BREAK from
the keyboard can also terminate MASSCALC, but in this case,
temporary files will not be cleaned up, and the history file will
not be properly closed which may result in the loss of some
information. The EXIT and QUIT commands are not case sensitive,
and can therefore be entered in upper, lower, or mixed case.
MASSCALC VERSION 1.00 1
Here are a few examples of valid EXIT and QUIT commands:
EXIT
Exit
exit
QUIT
Quit
quit
COMMENTS FOR CLARITY: Comments (documentation) are started with
the semicolon (;). This is the same character which ends
equations, so comments may immediately follow the end of an
equation. Here are some examples of how comments work in
MASSCALC:
;This is a comment line.
1 / sqrt (2); comment after an equation
;the preceding blank line is ignored
Blank lines are ignored in any input, and may even be inserted in
the middle of equations if desired. See the demo files for more
examples of MASSCALC comments.
EQUATION AND COMMAND SYNTAX: All mathematical expressions are
terminated with a semicolon (;) except as noted. Some special
commands do not require a terminating semicolon, and this
situation is described in the descriptions for such commands
below. Because equations are terminated by semicolons rather
than the end-of-line character, long equations can be split
across several lines as desired. Most MASSCALC equations and
commands can be entered in free form (except for the command,
function, and variable names), so blank spaces and tabs may be
inserted as desired into equations. Here are some examples:
z = x+y; equation ends here
z
=
x
+
y
; equation ends here
The maximum number of characters in an equation including any
trailing comments is defined in each distribution as follows:
100 SHAREWARE
1000 STUDENT
2000 FULL
MASSCALC VERSION 1.00 2
The maximum number of input lines allowed for each distribution
is as follows:
110 SHAREWARE
1010 STUDENT
unlimited FULL
See the MASSCALC demo files for more examples of command and
equation syntax. See the MAXIMUM VALUES AND LIMITS section in
this manual for a complete list of maximum MASSCALC values.
VARIABLES AND CONSTANTS: Variable names may begin with the
characters: _ (underline character), a-z (lower case alphabet),
A-Z (upper case alphabet), ' (apostrophe), and $ (dollar sign).
All predefined constant and variable names begin with a single
underline character (_), so avoid beginning variable names with
this character if possible to avoid confusion. The characters in
the variable name which follow the first character may be: _
(underline character), a-z (lower case alphabet), A-Z (upper case
alphabet), ' (apostrophe), $ (dollar sign), 0-9 (numerical
digits), . (period), blank space, and tab character. All of the
characters just described except for the blank space and tab
character may be the last character in a variable name. User
defined variable names are case sensitive, so "var1" is not the
same as "VAR1". All elements in user defined variables and
arrays are initialized to 0.0. The following are all examples of
legal MASSCALC variable names:
x
x1
x 1
descriptive thing
$y'
y'
a_b times c.d
A variable name containing a single space is not the same as a
variable name containing more than one space. For example, the
variables "x 1" and "x 1" are not treated as the same variable.
To display the value of a variable by itself, enter the variable
name as though it is an equation. For example, to see the value
stored in the variable big_array, enter the following:
big_array;
The maximum length of variable names is determined by the
distribution type as follows:
21 SHAREWARE
31 STUDENT
80 FULL
MASSCALC VERSION 1.00 3
See the MAXIMUM VALUES AND LIMITS section in this manual for a
complete list of maximum values.
Multidimensional arrays may be created with MASSCALC, and the
names of these arrays must follow the same syntax rules as single
element variables. To display an entire array, enter the array
name as a single equation as follows:
my_array;
To show the value stored in a particular element of an array,
subscripts must be included. Subscripts must be enclosed in
brackets ([...]), braces ({...}), or parentheses ((...)). For
example, if an array has been created with two dimensions (3 rows
and 4 columns), the last element in the array could be displayed
as follows:
my_array [3, 4];
and the element in row 2, column 1 would be displayed as follows:
my_array [2, 1];
When assigning values to whole arrays, only the number of
elements is critical, not the actual indexes. The array is
filled in row major fashion. For example:
array first is dimensioned [1, 4], and contains values: 1, 2, 3,
4. Array second is dimensioned [2, 2]. Both of these arrays
contain four elements, so the following assignment is legal in
MASSCALC:
second = first;
and after this assignment, the arrays would contain values as
follows:
first;
1 2 3 4
second;
1 2
3 4
Array second may then be assigned a value to a single one of its
elements as follows:
second [1, 1] = 8;
and then second would be displayed:
MASSCALC VERSION 1.00 4
second;
8 2
3 4
An array called third could then be created with dimensions [2,
2, 2], and could then be filled as follows:
third = first, second;
and could then be displayed:
third;
1 2
3 4
8 2
3 4
See the CREATE_ARRAY command described elsewhere in this manual
for more information concerning array creation. See the MASSCALC
demo files for more examples of array and variable names and
usage.
PREDEFINED CONSTANTS: These values are defined as constants
within MASSCALC. These constant names may be included anywhere
in equations, except where their value might be changed
(attempting to change the value of any of these constants will
result in an error). Constant names are not case sensitive, so
"_PI" is the same as "_pi". Due to compiler and hardware
limitations, only the first 16 significant figures may be valid
for these constants. Here are the predefined constant names and
the values assigned to them:
NAME VALUE
-------------------------------
_1_pi 0.318309886183790672
_1_sqrt_2 0.707106781186547524
_1_sqrt_pi 0.564189583547756287
_2_pi 0.636619772367581343
_2_sqrt_pi 1.12837916709551257
_base_10_e 0.434294481903251828
_base_2_e 1.44269504088896341
_e 2.71828182845904524
_ln_10 2.30258509299404568
_ln_2 0.693147180559945309
_pi 3.14159265358979324
_pi_2 1.57079632679489662
_pi_4 0.785398163397448310
_sqrt_2 1.41421356237309505
PREDEFINED VARIABLES: The variables described here are defined
by MASSCALC, but their values may be changed. Each of these
MASSCALC VERSION 1.00 5
variables is given a default value as described below. Most of
these variables may be assigned the result of an equation (i.e.
_tolerance = 3/5;), but there are exceptions which must be dealt
with as described below. All of the predefined variables begin
with one underline character (_), and are not case sensitive
(_TOLerance is the same as _tolerance).
_der_delta default value = 0.001
Delta value for first and second derivative calculations.
_fund_der_delta default value = 0.00001
Delta value for fundamental derivative calculations.
_max_iterations default value = 100
Maximum number of iterations for integral, root, and other
calculations.
_out_iterations default value = 0.0
Set = 0.0 to turn off iterative reports; set = any non-zero value
to turn on iterative reports. These reports are produced by some
functions and commands to show progress as calculations are
performed.
_scale default value = -14 14
Determines how many digits will be displayed in numeric output,
and whether the numbers will be left or right justified within
the specified space. A hyphen (-) in front of the first number
indicates left justification. The first set of digits indicates
the total number of digits to display, and the second set of
digits indicates how many decimal places to display. The valid
range for the first value is -20 through 20, and the valid range
for the second value is 0 through 20. Equations may not be used
to assign values to this special variable. Two numbers separated
by a non-numerical character or characters determine the value of
this variable. The following are examples of ways to assign
values to this variable:
_scale = 6 6;
_scale = 6.6;
_scale -8 6;
_scale12.10
A terminating semicolon (;) is not required when _scale is
accessed or assigned a value, since this value is not a standard
value. Whenever _scale is assigned a value, or when it is
entered on a line by itself, the resulting values for _scale are
displayed.
_tolerance default value = 0.000000000001
Function tolerance for iterative calculations.
MASSCALC VERSION 1.00 6
OPERATOR PRECEDENCE: These operators are handled in equations in
the order shown:
(), [], {} group parameters and sub-equations
<function_name> trig, log, or other functions
- uniary minus
^ raise a value to an exponent
*, / multiplication and division
+, - addition and subtraction
= value assignment
The following equation assigns the value of -4 to x:
x = - ((1 + 1) ^ log (100));
See the MASSCALC demo files for examples of equations.
COMMANDS: MASSCALC includes a variety of commands. These
commands need not be terminated with a semicolon (;) as in
equations, unless otherwise indicated. Some commands include
punctuation such as colons (:) and periods (.). These
punctuation marks must be included with the commands as shown.
Commands are not case sensitive, so "Print:" is the same as
"print:". See the MASSCALC demo files for examples of MASSCALC
commands.
ADD:
Adds a column of numbers or equations.
ADD:
<firstnum>
<secondnum>
<...>
ENDADD
<firstnum> and <secondnum> may be equations or numbers. They
need not be terminated with semicolons (;), because each line is
calculated as a complete equation, and then added to the total,
which is displayed when the endadd command is entered.
Semicolons may be used on each line if desired to add comments
for clarification. Many equations and numbers may be added
together (not just two as shown here). Accumulation of values
continues until ENDADD is entered. Refer to the MASSCALC demo
files for examples of this command.
ADD_INTO: <varname>
ADD INTO: <varname>
Adds a column of numbers or equations, and assigns the result to
the variable specified by <varname>.
MASSCALC VERSION 1.00 7
ADD INTO: total
<firstnum>
<secondnum>
<...>
ENDADD
This command works like ADD:, except that the result is assigned
to a variable (total in this case) instead of being displayed.
See also ADD:.
CLOSE_HISTORY_FILE.
CLOSE HISTORY FILE.
Closes the currently open history file. See also
"HISTORY_FILE:", "OPEN_HISTORY_FILE:", and "EXIT".
CREATE_ARRAY:
CREATE ARRAY:
DIMENSION_ARRAY:
DIMENSION ARRAY:
Creates an array, which may have more than one dimension.
CREATE_ARRAY: <name> (<dim1> [<dim2>, ...]);
<name> is the name of the array to be created. <dim1> is the
first dimension (displayed as a row in outputs). <dim2> is the
second dimension (displayed as columns in outputs). The
dimensions must be enclosed in either brackets ([...]), braces
({...}), or parenthesis ((...)). Dimensions can be considered to
be rows, columns, pages, books, shelves, sets of shelves
(stacks), libraries, and so on to the limits of the MASSCALC
distribution. Maximum numbers of dimensions for each MASSCALC
distribution are as follows:
3 SHAREWARE
6 STUDENT
255 FULL
The number of elements in each dimension may be from 1 to 2^32-1
as memory allows, which should be more than enough elements for
most applications. See the MAXIMUM VALUES AND LIMITS section in
this manual for a complete list of maximums. All elements in new
arrays are initialized to 0.0. In this example, a two
dimensional array is created with 2 rows and 3 columns:
CREATE_ARRAY: A [2, 3];
Array dimensions may be determined with equations if desired. If
the equation for a dimension is a non-integer value, the floor of
the result is used to determine the number of elements in that
dimension. If a dimension is about to be assigned a value of 0,
the dimension is assigned the value of 1 instead. This example
creates an array with two dimensions of [2, 2]:
dimension array: big [2 * 2 - 1.5, log (100)];
MASSCALC VERSION 1.00 8
In the full MASSCALC distribution, memory overflow files are
created for arrays which do not fit into memory. Array sizes are
limited by available main memory in the shareware and student
distributions. Whenever a variable name is used which has not
been assigned to a defined array or other variable, the variable
is defined automatically as a single element variable, and thus
does not need to be created or dimensioned. See also
"DELETE_ARRAY:", "REDIMENSION_ARRAY:", "SHOW_ARRAYS.", and
"SHOW_ARRAY_STRUCTURE:".
DELETE_ALL_ARRAYS.
DELETE ALL ARRAYS.
DELETE_ALL_VARIABLES.
DELETE ALL VARIABLES.
Removes all user defined variables and arrays from memory. Any
memory overflow files associated with any arrays are also
removed. See also "SHOW_arrays." and "DELETE_array:".
DELETE_ARRAY:
DELETE ARRAY:
DELETE_VARIABLE:
DELETE VARIABLE:
Removes a user defined variable or array from memory.
DELETE_ARRAY: <varname>
<varname> is the name of the array or variable to be deleted.
All memory overflow files associated with the array are deleted.
See also "DELETE_ALL_ARRAYS.", "CREATE_ARRAY:", and
"REDIMENSION_ARRAY:".
EXIT
Exits MASSCALC, closes the history file if it is open, deletes
any temporary memory overflow files, and returns control to the
operating system.
HISTORY_NAME:
HISTORY NAME:
Displays the name of the last opened history file, and whether
the file is currently open or closed. If no history file has
been opened since MASSCALC was started, "<no history opened>" is
displayed. See also "OPEN_HISTORY_FILE:" and
"CLOSE_HISTORY_FILE.".
OPEN_HISTORY_FILE:
OPEN HISTORY FILE:
Opens a history file with the specified name.
OPEN_HISTORY_FILE: <name>
<name> is the name of the file to open. While the history file
is open, all output produced by MASSCALC is written to the screen
and the history file. Only one history file may be opened at a
time, but files may be opened and closed as many times as the
user desires. If a history file is already open, the open file
is closed and the new history file is opened. If a file is
MASSCALC VERSION 1.00 9
opened which already exists, the output is appended to the end of
the existing file. File names must comply with the operating
system file name standards. See also "CLOSE_HISTORY_FILE.",
"EXIT", and "HISTORY_NAME:".
PRINT:
Prints a message on the screen.
PRINT: <message>
<message> is the message to be printed, and may include variables
and quoted text. This example displays the message "X ="
followed by the value stored in the variable x:
PRINT: "X = " x
See the MASSCALC demo files for examples of this command.
QUIT
See EXIT.
REDIMENSION_ARRAY:
REDIMENSION ARRAY:
Redefines the dimensions for an existing array, or creates a new
array with the specified dimensions.
REDIMENSION_ARRAY: <name> (<dim1[, <dim2>, ...]);
<name> is the name of the array to be created or re-dimensioned.
<dim1> and <dim2> are the new dimensions of the array, and the
number of dimensions are limited by the MASSCALC distribution.
See "CREATE_ARRAY:". All elements in the re-dimensioned array
are set = 0.0. This example re-dimensions array A to be a two
dimensional array with 4 rows and 2 columns:
REDIMENSION_ARRAY: A [4, 2];
This example re-dimensions an array to have three dimensions (2
rows, 3 columns, and 4 pages):
REDIMENSION_ARRAY: A [2, 3, 4];
See the MASSCALC demo files for more examples of arrays and their
usage.
REMOVE_ARRAY:
REMOVE ARRAY:
REMOVE_VARIABLE:
REMOVE VARIABLE:
See "DELETE_ARRAY:".
RUN_COMMAND:
RUN COMMAND:
Runs a command at the operating system level.
RUN_COMMAND:<command>
<command> is the command to be run. Operating system and other
MASSCALC VERSION 1.00 10
utilities and commands may be run with this command without
terminating the current MASSCALC session. These examples show
how the current directory may be listed:
RUN COMMAND:dir/w
RUN_COMMAND: dir/w
Refer to your operating system manual for information concerning
the dir command.
SHOW_ARRAY_STRUCTURE:
SHOW_VARIABLE_STRUCTURE:
SHOW ARRAY STRUCTURE:
SHOW VARIABLE STRUCTURE:
Displays information about the specified variable.
SHOW_ARRAY_STRUCTURE: <name>
<name> is the name of the variable or array whose structure is to
be displayed. The structure information includes: variable name,
number of elements, number of dimensions, and the dimensions.
The name of the memory overflow file is also given (memory
overflow files are only created in the full MASSCALC
distribution). Dimensions are given in rows, columns, pages,
books, shelves, and so on. See also "CREATE_ARRAY" and
"REDIMENSION_ARRAY".
SHOW_ARRAY_LIST.
SHOW_VARIABLE_LIST.
SHOW_ARRAYS.
SHOW_VARIABLES.
SHOW ARRAYS:
SHOW ARRAY LIST:
SHOW VARIABLES:
SHOW VARIABLE LIST:
Displays a list of the names of all of the user defined variables
and arrays. Single element variables are defined whenever a
variable name is used which has not already been defined. See
also "SHOW_ARRAY_STRUCTURE:".
FUNCTIONS: Function names are not case sensitive, so ArcTan(x)
is the same as arctan(x) and ARCTAN(x). All functions return one
or more values which may be assigned to an appropriately
dimensioned array or single element variable. Most of the
functions described here may be included as parts of equations,
and may even be nested (i.e. SIN(COS(x))). Those functions which
are exceptions to this rule are indicated in their respective
descriptions. If a multi-element array is passed to most of
these functions, the returned value is a similarly dimensioned
array with the function applied to each of the values in the
original array as its values (exceptions are noted in the
respective function descriptions). See the MASSCALC demo files
for more examples of function usage.
MASSCALC VERSION 1.00 11
ABS
Returns the absolute value of its single or multi-element
argument.
ABS (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
ARCCOS
Returns the arc-cosine of its single or multi-element argument.
ARCCOS (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
ARCSIN
Returns the arc-sine of its single or multi-element argument.
ARCSIN (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
ARCTAN
Returns the two quadrant arc-tangent of its single or multi-
element argument.
ARCTAN (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
ARCTAN4
Returns a four quadrant arc-tangent value for the given
coordinates.
ARCTAN4 (<yvalue>, <xvalue>)
<yvalue> and <xvalue> are numeric values, variable names, or
equations whose results are to be passed as the arguments to the
function. <yvalue> is the y (vertical) coordinate on the plane,
and <xvalue> is the x (horizontal) coordinate on the plane. Both
of the arguments passed to this function must be single element
values.
ARCTAN_4
See ARCTAN4.
CEIL
Returns the ceiling of its single or multi-element argument.
CEIL (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
COS
Returns the cosine of its single or multi-element argument.
COS (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
MASSCALC VERSION 1.00 12
COSEC
Returns the cosecant of its single or multi-element argument.
COSEC (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
COTAN
Returns the cotangent of its single or multi-element argument.
COTAN (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
DERIVATIVE
Returns the first or second derivative of an equation.
DERIVATIVE (<dernum>, <var>, <equation>)
This function may not be included in other functions or
equations. This function may be used to assign a value to a
variable or array element. <dernum> is the derivative to find,
and must be either 1 or 2. <var> is the name of the independent
variable, which must have been assigned the value to use in the
calculation. <equation> is the equation to be derived. All
variables and values in <equation> must be single element values.
<var> must be part of <equation>. <equation> is merged with the
fundamental theorem of calculus to find the derivatives. The
accuracy of this function is effected by the predefined variable
_FUND_DER_DELTA. See also DERIVATIVE_1 and DERIVATIVE_2.
DERIVATIVE_1
Returns the first derivative of an equation.
DERIVATIVE_1 (<var>, <equation)
This function may not be included in other functions or
equations. This function may be used to assign a value to a
variable or array element. <var> is the name of the independent
variable, which must have been assigned the value to use in the
calculation. <equation> is the equation to be derived. All
variables and values in <equation> must be single element values.
<var> must be part of <equation>. The accuracy of this function
is effected by the predefined variable _DER_DELTA. Central point
difference formulas are used to find the result for this
function. See also DERIVATIVE_2 and DERIVATIVE.
DERIVATIVE_2
Returns the second derivative of an equation.
DERIVATIVE_2 (<var>, <equation>)
This function may not be included in other functions or
equations. This function may be used to assign a value to a
variable or array element. <var> is the name of the independent
variable, which must have been assigned the value to use in the
calculation. <equation> is the equation to be derived. All
variables and values in <equation> must be single element values.
<var> must be part of <equation>. The accuracy of this function
is effected by the predefined variable _DER_DELTA. Central point
MASSCALC VERSION 1.00 13
difference formulas are used to find the result for this
function. See also DERIVATIVE_1 and DERIVATIVE.
DERIVE_LIST
Returns derivative values for the given list of equal spaced
data.
DERIVE_LIST (<interval>, <list>)
<interval> is the interval between points, expressed as a single
value, a single element variable, or an equation which produces a
single element value. <list> is the name of a multi-element
array which contains the list of point values. At least three
values must be contained in the list for this function to
calculate the derivatives. Central point difference formulas are
used to calculate the derivatives for the inner points. A
quadratic formula is used to calculate the derivatives at the end
points.
EXP
Returns the exponential of its single or multi-element argument.
EXP (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
FLOOR
Returns the floor of its single or multi-element argument.
FLOOR (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
HYPCOS
Returns the hyperbolic cosine of its single or multi-element
argument.
HYPCOS (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
HYPSIN
Returns the hyperbolic sine of its single or multi-element
argument.
HYPSIN (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
HYPTAN
Returns the hyperbolic tangent of its single or multi-element
argument.
HYPTAN (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
MASSCALC VERSION 1.00 14
INTEG_A_SIMPSON
Returns the bounded integral of an equation using the Simpson
method.
INTEG_A_SIMPSON (<var>, <low>, <high>, <equation>)
This function may not be included in other functions or
equations. This function may be used to assign a value to a
variable or array element. <var> is the name of the variable to
integrate with. <low> is the low end of the integration range.
<high> is the high end of the integration range. <equation> is
the equation to be integrated in the given range. <low> and
<high> may be numeric values or equations which return single
element numeric solutions. All variables and values in
<equation> must be single element values. The error tolerance of
this function is defined by the predefined variable _TOLERANCE.
INTEG_LIST
Returns the integral value for the given list of equal spaced
data.
INTEG_LIST (<interval>, <list>)
<interval> is the interval between points, expressed as a single
value, a single element variable, or an equation which produces a
single element value. <list> is the name of a multi-element
array which contains the list of point values. At least three
values must be contained in the list for this function to
calculate the integral. Integration is performed with the
Simpson method.
LN
Returns the natural logarithm of its single or multi-element
argument.
LN (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
LOG
Returns the base 10 logarithm of its single or multi-element
argument.
LOG (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
LOG_B
Returns the logarithm using the specified base for its single or
multi-element argument.
LOG_B (<base>, <value>)
<base> is a numeric value, a single element variable, or an
equation whose result produces a single element value. <value>
is a numeric value, a variable name, or an equation whose result
is to be passed as the argument to the function. <value> may be
a single or multi-element value.
MASSCALC VERSION 1.00 15
MOD
Returns the remainder or remainders from division.
mod (<dividend>, <divisor>)
<dividend> is a single or multi-element numeric value, variable
or array name, or an equation. <divisor> is a single element
numeric value, variable name, or equation which produces a single
element result.
ROOT_INTHALF
Returns the root of an equation through interval halving.
ROOT_INTHALF (<var>, <low>, <high>, <equation>)
This function may not be included in other functions or
equations. This function may be used to assign a value to a
variable or array element. <var> is the name of the independent
variable. <low> is the low end of the test range. <high> is the
high end of the test range. <equation> is the equation whose
root is to be found. <low> and <high> may be numeric values or
equations which return single element numeric solutions. All
variables and values in <equation> must be single element values.
The error tolerance of this function is defined by the predefined
variable _TOLERANCE. The number of iterations performed during
calculations in this function is limited by the predefined
variable _MAX_ITERATIONS. Output from iterations during function
operation is either off or on, depending on whether the
predefined variable _OUT_ITERATIONS equals 0.0 or not.
ROOT_LININT
Returns the root of an equation through linear interpolation.
ROOT_LININT (<var>, <low>, <high>, <equation>)
This function may not be included in other functions or
equations. This function may be used to assign a value to a
variable or array element. <var> is the name of the independent
variable. <low> is the low end of the test range. <high> is the
high end of the test range. <equation> is the equation whose
root is to be found. <low> and <high> may be numeric values or
equations which return single element numeric solutions. All
variables and values in <equation> must be single element values.
The error tolerance of this function is defined by the predefined
variable _TOLERANCE. The number of iterations performed during
calculations in this function is limited by the predefined
variable _MAX_ITERATIONS. Output from iterations during function
operation is either off or on, depending on whether the
predefined variable _OUT_ITERATIONS equals 0.0 or not.
ROOT_MULLER
Returns the root of an equation through the Muller method.
ROOT_MULLER (<var>, <start_val>, <step>, <equation>)
This function may not be included in other functions or
equations. This function may be used to assign a value to a
variable or array element. <var> is the name of the independent
variable. <start_val> is the starting point. <step> is the step
(delta) value. <equation> is the equation whose root is to be
MASSCALC VERSION 1.00 16
found. <start_val> and <step> may be numeric values or equations
which return single element numeric solutions. All variables and
values in <equation> must be single element values. The error
tolerance of this function is defined by the predefined variable
_TOLERANCE. The number of iterations performed during
calculations in this function is limited by the predefined
variable _MAX_ITERATIONS. Output from iterations during function
operation is either off or on, depending on whether the
predefined variable _OUT_ITERATIONS equals 0.0 or not.
ROOT_NEWTON
Returns the root of an equation through Newton's method.
ROOT_NEWTON (<var>, <start_val>, <equation>, <derivative>)
This function may not be included in other functions or
equations. This function may be used to assign a value to a
variable or array element. <var> is the name of the independent
variable. <start_val> is the starting point. <equation> is the
equation whose root is to be found. <derivative> is the
derivative of the equation whose root is to be found.
<start_val> may be a numeric value or an equation which returns a
single element numeric solution. All variables and values in
<equation> and <derivative> must be single element values. The
error tolerance of this function is defined by the predefined
variable _TOLERANCE. The number of iterations performed during
calculations in this function is limited by the predefined
variable _MAX_ITERATIONS. Output from iterations during function
operation is either off or on, depending on whether the
predefined variable _OUT_ITERATIONS equals 0.0 or not.
ROOT_SECANT
Returns the root of an equation through the secant method.
ROOT_SECANT (<var>, <low>, <high>, <equation>)
This function may not be included in other functions or
equations. This function may be used to assign a value to a
variable or array element. <var> is the name of the independent
variable. <low> is the low end of the test range. <high> is the
high end of the test range. <equation> is the equation whose
root is to be found. <low> and <high> may be numeric values or
equations which return single element numeric solutions. All
variables and values in <equation> must be single element values.
The error tolerance of this function is defined by the predefined
variable _TOLERANCE. The number of iterations performed during
calculations in this function is limited by the predefined
variable _MAX_ITERATIONS. Output from iterations during function
operation is either off or on, depending on whether the
predefined variable _OUT_ITERATIONS equals 0.0 or not.
SEC
Returns the secant of its single or multi-element argument.
SEC (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
MASSCALC VERSION 1.00 17
SIN
Returns the sine of its single or multi-element argument.
SIN (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
SQRT
Returns the square root of its single or multi-element argument.
SQRT (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
TAN
Returns the tangent of its single or multi-element argument.
TAN (<value>)
<value> is a numeric value, a variable name, or an equation whose
result is to be passed as the argument to the function.
TEMPORARY MEMORY OVERFLOW FILES: The full distribution of
MASSCALC may produce some memory overflow files for tables of
numbers which can not be stored in the computer's main memory.
These files contain only the numeric data, which is stored as 64
bit double precision floating point values. These files are
temporarily stored in a directory defined by one of the following
operating system environment variables:
MASSCALCTEMP
TMP
TEMP
The directory name is searched for in the environment variables
shown above in the order shown. If none of the environment
variables shown here are defined, MASSCALC writes its temporary
memory overflow files to the current directory. See your
operating system manual for information concerning the SET
command for creating and viewing environment variables.
ERRORS AND ERROR MESSAGES: MASSCALC may produce error messages
under certain circumstances. The error messages produced by
MASSCALC are described below. Some errors may leave random or
incomplete values in variables or tables of values as noted
below. Error messages are output along with the line number of
the input where the error occurred. The descriptions below
include the error name, the text of the error message as
displayed in the output, and a description of what the error
might mean.
ADJACENT_OPERATOR_ERROR
Adjacent operators not allowed.
Two operators were found in the equation without an operand
(variable, number, function, etc.) between them.
MASSCALC VERSION 1.00 18
ARCTAN_4_ERROR
Multi-element arrays not allowed in arctan_4 function.
One or both of the parameters passed to ARCTAN4 or ARCTAN_4 was a
multi-element value.
ASSIGNMENT_ADD_ERROR
= not valid while adding a column of values.
The equal sign (=) was entered on a line between the ADD: or
ADD_INTO: command, and the ENDADD command.
ASSIGNMENT_PRINT_ERROR
Assignment not valid in print: command.
An equal sign (=) was found outside of the quotation marks
("...") in a PRINT: command.
CALC_ERROR
Attempted divide by 0.
The denominator in a division was approximately equal to 0.0.
CONSTANT_VARIABLE_ERROR
Constant used as a variable.
An attempt was made to assign a value to a predefined constant.
COMM_STACK_UNDERFLOW_ERROR
Attempt to end too many command structures.
Too many commands were removed from the internal calculator
command stack.
CREATION_ERROR
Can not create array ...
A variable could not be created or re-dimensioned for the reason
given in the output.
DERIVE_COUNT_ERROR
Can not calculate derivative # ...
A derivative number other than 1 or 2 was passed as a parameter
to the DERIVE_FUNDAMENTAL function. Only first (1) and second
(2) derivatives are allowed here.
DIMENSION_BOUNDARY_ERROR
Dimension is outside of array [<varname>].
The value given in an array subscript is too high. <varname> is
the name of the variable whose subscript was over reached.
DIMENSION_COUNT_ERROR
Arrays have different number of dimensions ...
Arrays or variables in an addition or subtraction process did not
have the same number of dimensions.
MASSCALC VERSION 1.00 19
DIMENSION_DIVISION_ERROR
Multi-element denominator in division.
The denominator in a division process contained more than one
element.
DIMENSION_MATCH_ERROR
Arrays have different dimensions ...
Arrays or variables did not have the same dimensions in an
addition or subtraction operation.
DIMENSION_MAXIMUM_ERROR
Maximum permitted number of dimensions exceeded.
Too many dimensions were assigned to a variable while creating or
re-dimensioning an array.
DIMENSION_MULTIPLY_ERROR
Can not calculate arrays ...
An invalid situation occurred while attempting to multiply two
arrays together as described in the output.
ELEMENT_OVERFLOW_ERROR
Too much data for array [<varname>].
Too much data was produced to assign it all to the given array or
variable. <varname> is the name of the array or variable which
did not contain enough elements to hold all of the data.
ELEMENT_UNDERFLOW_ERROR
Not enough data for array [<varname>].
Insufficient data were produced to assign values to all of the
elements in the given array. <varname> is the name of the array
which was not completely assigned data.
ENTRY_ERROR
Improperly formatted equation ...
An input line was found that could not be understood. The line
contains at least one syntax error which could not be found with
the other error checking in MASSCALC.
EQUALS_ERROR
Too many equal signs.
More than one equal sign (=) was found in a single equation.
FILE_ERROR
Memory overflow file for ...
An error occurred while trying to write to, read from, or create
a memory overflow file. Memory overflow files are created only
in the full distribution of MASSCALC.
MASSCALC VERSION 1.00 20
FUNCTION_USAGE_ERROR
Invalid usage of function or invalid function name.
An array subscript has been taken as a function parameter or
parameters, or the number of commas (,) fooled MASSCALC into
looking for a function name where no valid function name existed.
HILO_RANGE_ERROR
Function has same sign at high and low values.
An iterative function such as some of the root and integral
functions which required a user defined range (low and high
values) could not find a solution in the specified range.
HISTFILE_ERROR
Can not open history file [<filename>].
The history file named <filename> could not be opened for
appending ASCII records.
ILLEGAL_SUBSCRIPT_ERROR
Subscript not a single value.
An array subscript was not a single element value.
INTEGRAL_UNDERFLOW_ERROR
Integration stack underflow.
An integral calculation resulted in the integral stack being read
too many times.
ITERATION_ERROR
Iteration count error.
An iterative function (such as some root and integral functions)
tried to perform more than MAX_ITERATIONS attempts to solve the
given equation.
LAST_CHARACTER_ERROR
Last active character in line is invalid: [<char>].
An equation was entered whose last character was <char>, which
was not a valid character to end an equation with.
LOG_BASE_ERROR
Array can not be the base for a logarithm.
The <base> parameter in the LOG_B function was not a single
element value.
MAX_IN_LINES_ERROR
Maximum number of allowed input lines exceeded.
The maximum number of allowed input lines was reached. When this
error occurs, the history file is closed if it was open, and
MASSCALC terminates and returns control to the operating system.
This error does not occur in the full distribution.
MAX_LINE_LENGTH_ERROR
Maximum line length exceeded.
The entered equation or other information was too long. The
MASSCALC VERSION 1.00 21
input line is terminated in most cases by a semicolon (;); not
necessarily by a line feed character. Missing semicolons at the
end of equations may cause this error.
MISPLACED_CLOSE_ERROR
Misplaced , ) ] or }.
One of the listed characters was found in an illegal position in
the input line.
MISPLACED_OPEN_ERROR
Misplaced ( [ { or ,.
One of the listed characters was found in an illegal position in
the input line.
MISSING_VARIABLE_ERROR
Variable name must be entered to left of =.
An equal sign (=) was entered as the first character of an
equation.
MOD_ERROR
Array can not be the divisor in modula division.
A multi-element array was passed as the divisor parameter in the
MOD function.
OPERAND_OVERFLOW_ERROR
Calculator operand stack overflow.
The calculator operand stack overflowed while trying to solve an
equation.
OPERAND_UNDERFLOW_ERROR
Calculator operand stack underflow.
The calculator operand stack was read too many times.
OPERATOR_OVERFLOW_ERROR
Calculator operator stack overflow.
The calculator operator stack overflowed while trying to solve an
equation.
OPERATOR_UNDERFLOW_ERROR
Calculator operator stack underflow.
The calculator operator stack was read too many times.
POWER_ERROR
Multi-element array included in exponent calculation.
A multi-element value was found in either the exponent or the
mantissa in a power calculation.
SHORT_LIST_ERROR
List must contain 3 or more elements for calculations.
The array passed as the list of values in a derivative or
integral calculation did not contain at least 3 elements.
MASSCALC VERSION 1.00 22
SPECIAL_DIMENTION_ERROR
Multi-element array included in special function.
A multi-element array was found in a function which requires only
single values.
SPEC_OP_PLACE_ERROR
Special restricted functions not allowed here.
A derivative, integral, or root function is in a location that is
not allowed, such as in an equation. These functions may not be
included as parts of equations or as parameters of functions.
STEP_ERROR
Step must be a single value.
The step (delta) value in the function is not a single element
value.
SYNTAX_DERIVE_ERROR
Syntax error in derivative function.
One or more of the required parameters is missing in either the
DERIVATIVE_1 or DERIVATIVE_2 function.
SYNTAX_FUNDAMENTAL_ERROR
Syntax error in fundamental derivative.
One or more of the required parameters is missing in the
fundamental derivative function.
SYNTAX_INTEG_ERROR
Syntax error in integral function.
One or more of the required parameters is missing in one of the
integral functions (name begins with INTEG_).
SYNTAX_ROOT_ERROR
Syntax error in root function.
One or more of the required parameters is missing in one of the
root functions (name begins with ROOT_).
UNBALANCED_ERROR
Unbalanced (), [], or {}.
Too many or too few of one or more of these operators were found.
VARIABLE_ERROR
Illegal variable name [<varname>].
At least one invalid character was found in a variable name.
<varname> is the illegal variable name found by MASSCALC.
MAXIMUM VALUES AND LIMITS: MASSCALC includes some limits, some
of which are different depending on whether the shareware,
student, or full distribution is being used. Here is a list of
the limits imposed by MASSCALC. UNLIMITED values listed here are
not limited by MASSCALC, but may be restricted by hardware or
operating system limitations. MASSCALC operates completely
within main memory, except where data memory overflow files are
allowed.
MASSCALC VERSION 1.00 23
SHAREWARE DISTRIBUTION LIMITS
maximum number of array dimensions = 3
maximum number of input lines allowed = 110
maximum line length = 100
maximum variable name length = 20
memory overflow files are not allowed
STUDENT DISTRIBUTION LIMITS
maximum number of array dimensions = 6
maximum number of input lines allowed = 1,010
maximum line length = 1,000
maximum variable name length = 30
memory overflow files are not allowed
FULL DISTRIBUTION LIMITS
maximum number of array dimensions = 255
maximum number of input lines allowed = UNLIMITED
maximum line length = 2000
maximum variable name length = 80
memory overflow files are allowed for array data
MASSCALC VERSION 1.00 24